home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / pine / osdep / os-dos.h < prev    next >
C/C++ Source or Header  |  1996-06-12  |  16KB  |  460 lines

  1. #line 2 "osdep/os-dos.h"
  2. /*----------------------------------------------------------------------
  3.   $Id: os-dos.h,v 5.48 1996/06/12 17:17:43 mikes Exp $
  4.  
  5.             T H E    P I N E    M A I L   S Y S T E M
  6.  
  7.    Laurence Lundblade and Mike Seibel
  8.    Networks and Distributed Computing
  9.    Computing and Communications
  10.    University of Washington
  11.    Administration Builiding, AG-44
  12.    Seattle, Washington, 98195, USA
  13.    Internet: lgl@CAC.Washington.EDU
  14.              mikes@CAC.Washington.EDU
  15.  
  16.    Please address all bugs and comments to "pine-bugs@cac.washington.edu"
  17.  
  18.  
  19.    Pine and Pico are registered trademarks of the University of Washington.
  20.    No commercial use of these trademarks may be made without prior written
  21.    permission of the University of Washington.
  22.  
  23.    Pine, Pico, and Pilot software and its included text are Copyright
  24.    1989-1996 by the University of Washington.
  25.  
  26.    The full text of our legal notices is contained in the file called
  27.    CPYRIGHT, included with this distribution.
  28.  
  29.  
  30.    Pine is in part based on The Elm Mail System:
  31.     ***********************************************************************
  32.     *  The Elm Mail System  -  Revision: 2.13                             *
  33.     *                                                                     *
  34.     *             Copyright (c) 1986, 1987 Dave Taylor              *
  35.     *             Copyright (c) 1988, 1989 USENET Community Trust   *
  36.     ***********************************************************************
  37.  
  38.  
  39.   ----------------------------------------------------------------------*/
  40.  
  41. #ifndef _OS_INCLUDED
  42. #define _OS_INCLUDED
  43.  
  44.  
  45. /*----------------------------------------------------------------------
  46.  
  47.    This first section has some constants that you may want to change
  48.    for your configuration.  This is the DOS version of the os.h file.
  49.    Further down in the file are os-dependent things that need to be set up
  50.    correctly for each os.  They aren't interesting, they just have to be
  51.    right.  There are also a few constants down there that may be of
  52.    interest to some.
  53.  
  54.  ----*/
  55.  
  56. /*----------------------------------------------------------------------
  57.  Define this if you want the disk quota to be checked on startup.
  58.  Of course, this only makes sense if your system has quotas.  If it doesn't,
  59.  there should be a dummy disk_quota() routine in os-xxx.c so that defining
  60.  this won't be harmful anyway.
  61.  ----*/
  62. /* #define USE_QUOTAS */
  63.  
  64.  
  65.  
  66. /*----------------------------------------------------------------------
  67.    Define this if you want to allow the users to change their From header
  68.    line when they send out mail.  The users will still have to configure
  69.    either default-composer-hdrs or customized-hdrs to get at the From
  70.    header, even if this is set.
  71.  ----*/
  72. /* #define ALLOW_CHANGING_FROM  /* comment out to not allow changing From */
  73.  
  74.  
  75.  
  76. /*----------------------------------------------------------------------
  77.     Turn this on if you want to disable the keyboard lock function.
  78.  ----*/
  79. /* #define NO_KEYBOARD_LOCK */
  80.  
  81.  
  82.  
  83. /*----------------------------------------------------------------------
  84.     Turn this on to trigger QP encoding of sent message text if it contains
  85.   "From " at the beginning of a line or "." on a line by itself.
  86.  ----*/
  87. /* #define ENCODE_FROMS */
  88.  
  89.  
  90.  
  91. /*----------------------------------------------------------------------
  92.     Turn this on if you want to disable PC-Pine's including of 
  93.   "X-Warning" and "X-Sender" header lines in outgoing messages.
  94.  ----*/
  95. /* #define NOAUTH */
  96.  
  97.  
  98.  
  99. /*----------------------------------------------------------------------
  100.     Timeouts (seconds)
  101.  ----*/
  102. #define DF_MAILCHECK      "150" /* How often to check for new mail, by
  103.                    default.  There's some expense in doing
  104.                    this so it shouldn't be done too
  105.                    frequently.  (Can be set in config
  106.                    file now.)  */
  107.  
  108. /*----------------------------------------------------------------------
  109.     Check pointing (seconds)
  110.  ----*/
  111. #define CHECK_POINT_TIME (7*60) /* Check point the mail file (write changes
  112.                    to disk) if more than CHECK_POINT_TIME
  113.                    seconds have passed since the first
  114.                    change was made.  Depending on what is
  115.                    happening, we may wait up to three times
  116.                    this long, since we don't want to do the
  117.                    slow check pointing and irritate the user. */
  118.                                      
  119. #define CHECK_POINT_FREQ   (12) /* Check point the mail file if there have been
  120.                                    at least this many (status) changes to the
  121.                    current mail file.  We may wait longer if
  122.                    it isn't a good time to do the checkpoint. */
  123.  
  124.  
  125.  
  126. /*----------------------------------------------------------------------
  127.  In scrolling through text, the number of lines from the previous
  128.  screen to overlap when showing the next screen.  Usually set to two.
  129.  ----*/
  130. #define    DF_OVERLAP    "2"
  131.  
  132.  
  133.  
  134. /*----------------------------------------------------------------------
  135.  When scrolling screens, the number of lines from top and bottom of
  136.  the screen to initiate single-line scrolling.
  137.  ----*/
  138. #define    DF_MARGIN    "0"
  139.  
  140.  
  141.  
  142. /*----------------------------------------------------------------------
  143.  Default fill column for pine composer and maximum fill column.  The max
  144.  is used to stop people from setting their custom fill column higher than
  145.  that number.  Note that DF_FILLCOL is a string but MAX_FILLCOL is an integer.
  146.  ----*/
  147. #define    DF_FILLCOL    "74"
  148. #define    MAX_FILLCOL    80
  149.  
  150.  
  151.  
  152. /*----- System-wide config file ----------------------------------------*/
  153. #define SYSTEM_PINERC "pinerc"
  154.  
  155.  
  156.  
  157. /*----- Used only in DOS -----------------------------------------------*/
  158. #define DF_PINEDIR      "\\pine"
  159. #define HELPFILE        "pine.hlp"
  160. #define HELPINDEX       "pine.ndx"
  161.   
  162.   
  163.   
  164. /*----------------------------------------------------------------------
  165.    The default folder names and folder directories (some for backwards
  166.    compatibility).  Think hard before changing any of these.
  167.  ----*/
  168. #define DF_DEFAULT_FCC            "sentmail"
  169. #define DEFAULT_SAVE              "savemail"
  170. #define POSTPONED_MAIL            "postpone"
  171. #define POSTPONED_MSGS            "postpond"
  172. #define INTERRUPTED_MAIL          "intruptd"
  173. #define DEADLETTER                "deadletr"
  174. #define    DF_FOLDER_EXTENSION      "MTX"
  175. #define DF_MAIL_DIRECTORY         "mail"
  176. #define INBOX_NAME                "INBOX"
  177. #define DF_SIGNATURE_FILE         "pine.sig"
  178. #define DF_ELM_STYLE_SAVE         "no"
  179. #define DF_HEADER_IN_REPLY        "no"
  180. #define DF_OLD_STYLE_REPLY        "no"
  181. #define DF_USE_ONLY_DOMAIN_NAME   "no"
  182. #define DF_FEATURE_LEVEL          "sapling"
  183. #define DF_SAVE_BY_SENDER         "no"
  184. #define DF_SORT_KEY               "arrival"
  185. #define DF_AB_SORT_RULE           "fullname-with-lists-last"
  186. #define DF_SAVED_MSG_NAME_RULE    "default-folder"
  187. #define DF_FCC_RULE               "default-fcc"
  188. #define DF_STANDARD_PRINTER       "lpr"
  189. #define ANSI_PRINTER              "attached-to-ansi"
  190. #define DF_ADDRESSBOOK            "addrbook"
  191. #define DF_BUGS_FULLNAME          "Pine Developers"
  192. #define DF_BUGS_ADDRESS           "pine-bugs@cac.washington.edu"
  193. #define DF_SUGGEST_FULLNAME       "Pine Developers"
  194. #define DF_SUGGEST_ADDRESS        "pine-suggestions@cac.washington.edu"
  195. #define DF_PINEINFO_FULLNAME      "Pine-Info News Group"
  196. #define DF_PINEINFO_ADDRESS       "pine-info@cac.washington.edu"
  197. #define DF_LOCAL_FULLNAME         "Local Support"
  198. #define DF_LOCAL_ADDRESS          "postmaster"
  199. #define DF_KBLOCK_PASSWD_COUNT    "1"
  200.  
  201. /*----------------------------------------------------------------------
  202.    The default printer when pine starts up for the first time with no printer
  203.  ----*/
  204. #define DF_DEFAULT_PRINTER        ANSI_PRINTER
  205.  
  206.  
  207.  
  208. /*----------------------------------------------------------------------
  209.  
  210.    OS dependencies, DOS version.  See also the os-dos.c files.
  211.    The following stuff may need to be changed for a new port, but once
  212.    the port is done it won't change.  Further down in the file are a few
  213.    constants that you may want to configure differently than they
  214.    are configured, but probably not.
  215.  
  216.  ----*/
  217.  
  218.  
  219.  
  220. /*----------------- Are we ANSI? ---------------------------------------*/
  221. #define ANSI
  222.  
  223. /*------ If our compiler doesn't understand type void ------------------*/
  224. /* #define void char */
  225.  
  226. /*-------- Standard ANSI functions usually defined in stdlib.h ---------*/
  227. #include <stdlib.h>
  228. /*---- Declare getenv() if not already declared ------------------------*/
  229. /* char *getenv(); */
  230.  
  231.  
  232. /*------- Standard string functions ------------------------------------*/
  233. #include <string.h>
  234. /*---- Declare these if not already declared ---------------------------*/
  235. /* char *strcpy(), *strncpy(); */
  236.  
  237.  
  238. /*------- Include types.h if you have it -------------------------------*/
  239. #include <sys/types.h>
  240.  
  241.  
  242. /*------- Some systems need this ---------------------------------------*/
  243. /* #include <stdarg.h> */
  244.  
  245.  
  246. #include <io.h>
  247. #include <sys/stat.h>
  248. #ifdef    PCTCP
  249. #include <4bsddefs.h>            /* PC/TCP Include Files */
  250. #include <netdb.h>
  251. #undef    signal                /* override their stupid def */
  252. #define    sleep    _sleep            /* use pico's sleep function */
  253. #undef    write                /* make way:c-client def's write */
  254. #undef    SIGCHLD
  255. #else
  256. #ifdef    LWP
  257. #include <sys/socket.h>            /* LanWorkplace Include Files */
  258. #include <netinet/in.h>
  259. #include <netdb.h>
  260. #else
  261. #ifdef    PCNFS
  262. #include <tklib.h>
  263. #include <netdb.h>
  264. #define    ENAMETOOLONG    0        /* unsupported errno value */
  265. #else
  266. #include <tcp.h>            /* WATTCP Include File */
  267. #define    ENAMETOOLONG    0        /* unsupported errno value */
  268. #define    word    p_word            /* compensate for bad args labels */
  269. #endif
  270. #endif
  271. #endif
  272. #include <dos.h>
  273. #include <direct.h>
  274. #include <memory.h>
  275. #include <fcntl.h>
  276. #include <sys/timeb.h>
  277.  
  278. #undef ERROR
  279.  
  280.  
  281. /*---- Declare sys_errlist() if not already declared -------------------*/
  282. /* extern char *sys_errlist[]; */
  283.  
  284.  
  285.  
  286. /*----------------- locale.h -------------------------------------------*/
  287. /* #include <locale.h>  /* To make matching and sorting work right */
  288.  
  289.  
  290.  
  291. /*----------------- time.h ---------------------------------------------*/
  292. #include <time.h>
  293. /* plain time.h isn't enough on some systems */
  294. /* #include <sys/time.h>  /* For struct timeval usually in time.h */ 
  295.  
  296.  
  297.  
  298. /*--------------- signal.h ---------------------------------------------*/
  299. #include <signal.h>
  300. /* #include <sys/signal.h> */
  301.  
  302. #define SigType void     /* value returned by sig handlers is void */
  303. /* #define SigType int      /* value returned by sig handlers is int */
  304.  
  305. /* #define POSIX_SIGNALS */
  306. /* #define SYSV_SIGNALS    /* use System-V signal semantics (ttyin.c) */
  307.  
  308.  
  309.  
  310.  
  311. /*-------------- A couple typedef's for integer sizes ------------------*/
  312. typedef unsigned long usign32_t;
  313. typedef unsigned short usign16_t;
  314.  
  315.  
  316.  
  317. /*-------------- qsort argument type -----------------------------------*/
  318. #define QSType void
  319. /* #define QSType char */
  320.  
  321.  
  322.  
  323. /*------ how help text is referenced (always char ** on Unix) ----------*/
  324. #define HelpType short
  325. #define NO_HELP (-1)
  326.  
  327.  
  328.  
  329. /*--------- System V terminal driver -----------------------------------*/
  330. /* #define HAVE_TERMIO   this is for pure System V */
  331. /* #define HAVE_TERMIOS  this is an alternative    */
  332. /*- Use the poll() system call instead of select() */
  333. /* #define USE_POLL */
  334. /*---- Use terminfo instead of termcap ---------------------------------*/
  335. /* #define USE_TERMINFO */
  336.  
  337.  
  338.  
  339. /*-------- Is window resizing available? -------------------------------*/
  340. /* #define RESIZING */
  341.     /* Actually, under windows it is, but RESIZING compiles in UNIX 
  342.      * signals code for determining when the window resized.  Window's
  343.      * works differently. */
  344.  
  345.  
  346.  
  347.  
  348. /*-------- If no vfork, use regular fork -------------------------------*/
  349. /* #define vfork fork */
  350.  
  351.  
  352.  
  353. /*----------------------------------------------------------------------
  354.     This is DOS specific and is used to determine if a mail message is
  355.  too big to fit in core.  It's just a static value now, but could be
  356.  turned into a fuller macro that takes an adaptive approach to figure
  357.  out what can fit into available free storage.
  358.  Examining mailboxes around here, it looks like 90-something percent of
  359.  messages come in under 8K so that seems like an OK limit on what can
  360.  be dealt with in core.
  361.  ----*/
  362. #define MAX_MSG_INCORE  (8192L)
  363.  
  364.  
  365.  
  366. /*----------------------------------------------------------------------
  367.     This is DOS specific and is used to pass the results of dos_gets
  368.  calls back to functions that had previously installed it as the
  369.  c-client "mailgets" allocation function.  It's basically a way around
  370.  c-client's exclusive use of malloc'd strings which is quite
  371.  impractical if we want to deal with text objects bigger than 64K on
  372.  DOS (assuming we even have 64 contiguous K anyway!).
  373.  ----*/
  374. extern  FILE    *append_file;
  375.  
  376.  
  377.  
  378. /*----------------------------------------------------------------------
  379.     This is DOS specific and is used to fake the results of SIGALRM
  380.  signal handling without an alarm system call.
  381.  ----*/
  382. #define  ALARM_BLIP()  fake_alarm_blip()
  383. extern    unsigned alarm(unsigned);
  384.  
  385.  
  386.  
  387. /*----- The usual sendmail configuration for sending mail on Unix ------*/
  388. /* #define SENDMAIL    "/usr/lib/sendmail" */
  389. /* #define SENDMAILFLAGS    "-bs -odb -oem"    /* send via smtp with backgroud
  390.                        delivery and mail back errors */
  391.  
  392.  
  393. /*--------- Program employed by users to change their password ---------*/
  394. /* #define    PASSWD_PROG    "" */
  395.  
  396.  
  397. /*-------------- A couple constants used to size arrays ----------------*/
  398. /* #include <sys/param.h>          /* Get it from param.h if available */
  399. /* #define MAXPATH MAXPATHLEN      /* Longest pathname we ever expect */
  400. #define MAXPATH        (128)    /* Longest pathname we ever expect */
  401. #define MAXFOLDER      (64)     /* Longest foldername we ever expect */  
  402.  
  403.  
  404. /*-- Max screen pine will display on. Used to define some array sizes --*/
  405. #define MAX_SCREEN_COLS  (170) 
  406. #define MAX_SCREEN_ROWS  (200) 
  407.  
  408.  
  409. /*---- When no screen size can be discovered this is the size used -----*/
  410. #define DEFAULT_LINES_ON_TERMINAL    (25)
  411. #define DEFAULT_COLUMNS_ON_TERMINAL    (80)
  412.  
  413.  
  414. /*----------------------------------------------------------------------
  415.     Where to put the output of pine in debug mode. Files are created
  416.  in the user's home directory and have a number appended to them when
  417.  there is more than one.
  418.  ----*/
  419. #define DEBUGFILE    "pinedebg.txt"
  420.  
  421. /*----------------------------------------------------------------------
  422.     The number of debug files to save in the user's home diretory. The files
  423.  are useful for figuring out what a user did when he complains that something
  424.  went wrong. It's important to keep a bunch around, usually 4, so that the
  425.  debug file in question will still be around when the problem gets 
  426.  investigated. Users tend to go in and out of Pine a few times and there
  427.  is one file for each pine invocation
  428.  ----*/
  429. #define NUMDEBUGFILES 4
  430.  
  431. /*----------------------------------------------------------------------
  432.    The default debug level to set (approximate meanings):
  433.        1 logs only highest level events and errors
  434.        2 logs events like file writes
  435.        3
  436.        4 logs each command
  437.        5
  438.        6 
  439.        7 logs details of command execution (7 is highest to run any production)
  440.        8
  441.        9 logs gross details of command execution
  442.  ----*/
  443. #define DEFAULT_DEBUG 2
  444.  
  445.  
  446.  
  447. /*----------------------------------------------------------------------
  448.     Various maximum field lengths, probably shouldn't be changed.
  449.  ----*/
  450. #define MAX_FULLNAME     (100) 
  451. #define MAX_NICKNAME      (40)
  452. #define MAX_ADDRESS      (200)
  453. #define MAX_NEW_LIST     (500)  /* Max addrs to be added when creating list */
  454. #define MAX_SEARCH       (100)  /* Longest string to search for             */
  455. #define MAX_ADDR_EXPN   (1000)  /* Longest expanded addr                    */
  456. #define MAX_ADDR_FIELD (10000)  /* Longest fully-expanded addr field        */
  457.  
  458.  
  459. #endif /* _OS_INCLUDED */
  460.